package top.maof.book.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import top.maof.book.json.EmojiDeserialize;
import top.maof.book.json.EmojiSerializer;

import java.io.Serializable;

@Data
@TableName("comment")
public class Comment implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @JsonSerialize(using = EmojiSerializer.class)
    @JsonDeserialize(using = EmojiDeserialize.class)
    private String content;

    private Integer userId;

    private Integer bookId;

    // 回复
    private Integer reply;

    // 在回复中又@某个回复进行交流
    private Integer communication;

    private Long time = System.currentTimeMillis();


    @TableField(fill = FieldFill.INSERT)
    private Long insertTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

}



